package com.ruowei.modules.member.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 用户收货信息表
 */
@ApiModel(description = "用户收货信息表")
@Entity
@Table(name = "member_receiving_info")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class MemberReceivingInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
    @SequenceGenerator(name = "sequenceGenerator")
    private Long id;

    /**
     * 收货信息编码
     */
    @ApiModelProperty(value = "收货信息编码")
    @Column(name = "info_code")
    private String infoCode;

    /**
     * 用户编码
     */
    @ApiModelProperty(value = "用户编码")
    @Column(name = "member_code")
    private String memberCode;

    /**
     * 收货人手机号
     */
    @ApiModelProperty(value = "收货人手机号")
    @Column(name = "phone")
    private String phone;

    /**
     * 收货人姓名
     */
    @ApiModelProperty(value = "收货人姓名")
    @Column(name = "name")
    private String name;

    // jhipster-needle-entity-add-field - JHipster will add fields here
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getInfoCode() {
        return infoCode;
    }

    public MemberReceivingInfo infoCode(String infoCode) {
        this.infoCode = infoCode;
        return this;
    }

    public void setInfoCode(String infoCode) {
        this.infoCode = infoCode;
    }

    public String getMemberCode() {
        return memberCode;
    }

    public MemberReceivingInfo memberCode(String memberCode) {
        this.memberCode = memberCode;
        return this;
    }

    public void setMemberCode(String memberCode) {
        this.memberCode = memberCode;
    }

    public String getPhone() {
        return phone;
    }

    public MemberReceivingInfo phone(String phone) {
        this.phone = phone;
        return this;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getName() {
        return name;
    }

    public MemberReceivingInfo name(String name) {
        this.name = name;
        return this;
    }

    public void setName(String name) {
        this.name = name;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof MemberReceivingInfo)) {
            return false;
        }
        return id != null && id.equals(((MemberReceivingInfo) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    // prettier-ignore
    @Override
    public String toString() {
        return "MemberReceivingInfo{" +
            "id=" + getId() +
            ", infoCode='" + getInfoCode() + "'" +
            ", memberCode='" + getMemberCode() + "'" +
            ", phone='" + getPhone() + "'" +
            ", name='" + getName() + "'" +
            "}";
    }
}
